﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EislaufScb.Model.Repository.Organisation;
using EislaufScb.Model;
using EislaufScb.WebForms.ViewModel;
using EislaufScb.Model.Repository;

namespace EislaufScb.WebForms.Views.Administration.Pesonal
{
    public partial class ManagePerson : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void SaveButton_OnClick(object sender, EventArgs e)
        {
            Person person = new Person();
            person.FirstName = PersonFirstName.Text;
            person.LastName = PersonLastName.Text;
            person.MiddleName = PersonMiddleName.Text;
            person.EMail = PersonEmail.Text;

            BaseRepository repository = new BaseRepository(new ClubModelContainer());
            repository.AddEntry<Person>(person);
            repository.Save(person);

        }
    }
}